/*
 * @Author      : ZhouQiJun
 * @Date        : 2025-11-05 20:37:18
 * @LastEditors : ZhouQiJun
 * @LastEditTime: 2025-11-06 11:07:29
 * @Description :
 */
import { fileURLToPath, URL } from 'node:url'

import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
//import vueJsx from '@vitejs/plugin-vue-jsx'
import federation from '@originjs/vite-plugin-federation'
// https://vite.dev/config/
export default defineConfig({
  // , vueJsx()
  plugins: [
    vue(),
    federation({
      name: 'remote-app',
      filename: 'remoteEntry.js',
      // Modules to expose
      exposes: {
        './Button': './src/Button.vue'
      },
      shared: ['vue', 'tdesign-vue-next']
    })
  ],
  build: {
    target: 'esnext'
  },
  resolve: {
    alias: {
      '@': fileURLToPath(new URL('./src', import.meta.url))
    }
  },
  preview: {
    port: 4173
  }
})
